package com.sanjiahantang.youjiaclient.module.common.views.impl;

import android.view.View;
import android.widget.TextView;

import com.sanjiahantang.youjiaclient.R;
import com.sanjiahantang.youjiaclient.base.BaseMvpActivity;
import com.sanjiahantang.youjiaclient.module.common.presenters.SettingsPresenter;
import com.sanjiahantang.youjiaclient.module.common.views.SettingsView;
import com.sanjiahantang.youjiaclient.module.money.views.impl.MeAddBankListActivity;

/**
 * Created by zy on 2017/8/8.
 */

public class SettingsActivity extends BaseMvpActivity<SettingsView,SettingsPresenter> implements View.OnClickListener,SettingsView {


    @Override
    public SettingsPresenter initPresenter() {
        return new SettingsPresenter();
    }

    @Override
    public void initView() {
        setContentView(R.layout.activity_settings);
        TextView title = (TextView) findViewById(R.id.title);
        title.setText("设置");
        findViewById(R.id.fl_Left).setOnClickListener(this);
        findViewById(R.id.myInfo).setOnClickListener(this);
        findViewById(R.id.addressManage).setOnClickListener(this);
        findViewById(R.id.changePWD).setOnClickListener(this);
        findViewById(R.id.changePayPWD).setOnClickListener(this);
        findViewById(R.id.txtLogout).setOnClickListener(this);
        findViewById(R.id.myBankCard).setOnClickListener(this);
    }

    @Override
    public void initData() {

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.myInfo:
                presenter.goMyInfo(this);
                break;
            case R.id.addressManage:
                presenter.goAddressManage(this);
                break;
            case R.id.changePWD:
                presenter.goChangePSD(this);
                break;
            case R.id.txtLogout:
                presenter.logout(this);
                break;
            case R.id.myBankCard:
                MeAddBankListActivity.fromSettings($this);
                break;
            case  R.id.fl_Left:
                finish();
                break;
            case R.id.changePayPWD:
                presenter.goChangePayPSD(this);
                break;
        }
    }

    @Override
    public void showProgress() {
        super.showProgress(this);
    }
}
